@extends('backend::layout')
@section('title',trans($page_title))
@section('content')
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('tools_btn')
            @component('backend::component.form.button')
                @slot('title') 添加品牌 @endslot
                @slot('elem') a @endslot
                @slot('btn') btn @endslot
                @slot('color') info @endslot
                @slot('icon') hcl-brand-add @endslot
                @slot('href') {{route('b_ShopBrand_create')}} @endslot
            @endcomponent
            @component('backend::component.form.button')
                @slot('title') 批量删除 @endslot
                @slot('btn') btn @endslot
                @slot('color') danger @endslot
                @slot('icon') hcl-remove @endslot
                @slot('class') btn-ajax @endslot
                @slot('params')
                    {"url":"{{route('b_ShopBrand_batchDelete')}}","method":"post","title":"批量删除品牌","targetData":".id","confirm":"true"}
                @endslot
            @endcomponent
        @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <table class="list table table-bordered table-striped">
                    <thead>
                    <tr>
                        <th>
                            @component('backend::component.checkbox')
                                @slot('name') ids-all @endslot
                            @endcomponent
                        </th>
                        <th>品牌名称</th><th>品牌地址</th><th>品牌状态</th><th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($list as $value)
                        <tr>
                            <td>
                                @component('backend::component.checkbox')
                                    @slot('name') ids[] @endslot
                                    @slot('class') id @endslot
                                    @slot('value') {{$value->id}} @endslot
                                @endcomponent
                            </td>
                            <td>
                                <img src="{{$value->logo}}" style="height: 40px;" />
                                {{$value->name}}</td>
                            <td>{{$value->url}}</td>
                            <td>
                                @component("backend::component.switch")
                                    @slot('params'){"url":"{{route('b_ShopBrand_state',['id'=>$value->id])}}"} @endslot
                                    @slot('checked') @if($value->status == 1) checked @endif @endslot
                                @endcomponent
                            </td>
                            <td>
                                @component('backend::component.form.button')
                                    @slot('title') 删除 @endslot
                                    @slot('icon') hcl-remove @endslot
                                    @slot('color') danger @endslot
                                    @slot('params') {"url":"{{route('b_ShopBrand_delete',['id'=>$value->id])}}","confirm":"true"} @endslot
                                    @slot('class') btn-ajax @endslot
                                @endcomponent
                                @component('backend::component.form.button')
                                    @slot('title') 编辑 @endslot
                                    @slot('elem') a @endslot
                                    @slot('href') {{route('b_ShopBrand_update',['id'=>$value->id])}} @endslot
                                    @slot('icon') hcl-edit1 @endslot
                                    @slot('color') primary @endslot
                                @endcomponent


                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            @else
                @component('backend::public.empty_page')
                    @slot('info') 暂时没有品牌 @endslot
                @endcomponent
            @endif
        @endslot
    @endcomponent
@endsection